Gives back the smallest number target has: array_min(scores) of 7, 3 and 9 is 3. Use it for the lowest cooldown or the shortest distance.
array_min(target) -> element| Name | Type |
|---|---|
target | array |
element
Gives back the smallest number in target, an array. array_min(scores) of 7, 3 and 9 is 3. Use it for the lowest cooldown or the shortest distance.
var scores = array_create(3, 0);
scores[0] = 7;
scores[1] = 3;
scores[2] = 9;
var answer = array_min(scores); // 30, and the game carries on.list_sort_by, then take the first one.One pass over the items.
One pass from the first item to the last, keeping the smallest seen so far - nothing is changed or copied. For a array of array_length(target) items it takes that many comparisons. Whole numbers and decimals only; text, yes-or-no values, structs and references are refused when the project is checked. An empty one gives back 0.